# !/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt

if __name__ == '__main__':
    # 显示中文
    plt.rcParams['font.sans-serif'] = [u'SimHei']
    plt.rcParams['axes.unicode_minus'] = False

    x = np.arange(1, 20)
    plt.plot(x, x)
    plt.plot(x, x * 2)
    plt.plot(x, x * 3)
    plt.plot(x, x * 4)

    # legend需要放在绘图后面
    plt.legend(['A', 'B', 'C', 'D'])
    plt.show()
